Remove trailing whitespace in source.
authorrobertl <robertl>
Fri, 28 Aug 2009 17:08:55 +0000 (17:08 +0000)
committerrobertl <robertl>
Fri, 28 Aug 2009 17:08:55 +0000 (17:08 +0000)
18 files changed:
gui/advdlg.cpp
gui/dpencode.cpp
gui/filterdata.cpp
gui/filterdlg.cpp
gui/filterwidgets.cpp
gui/formatload.cpp
gui/gmapdlg.cpp
gui/gpx.cpp
gui/help.cpp
gui/latlng.cpp
gui/main.cpp
gui/mainwindow.cpp
gui/mainwindow.h
gui/map.cpp
gui/optionsdlg.cpp
gui/processwait.cpp
gui/serial_mac.cpp
gui/upgrade.cpp

index a9ec00adf261fde92e5daabfbe15dc22ed4c8011..885e7c491b79db06d80bf181769fe248f7452c05 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: advdlg.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: advdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -26,8 +26,8 @@
 #include "advdlg.h"
 
 //------------------------------------------------------------------------
-AdvDlg::AdvDlg(QWidget* parent, 
-              bool &synthShortNames, 
+AdvDlg::AdvDlg(QWidget* parent,
+              bool &synthShortNames,
               bool &forceGPSTypes,
               bool &enableCharSetXform,
               bool &previewGmap,
index 62db5761156022b5afb8c9de6b68cbb40dde3262..63f12dbf42dd12bdcac50abeacf2de6c44a3381c 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: dpencode.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: dpencode.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Original in JavaScript: 
@@ -40,7 +40,7 @@ PolylineEncoder::PolylineEncoder(int numLevels, double zoomFactor, double vs):
 {
   if (verySmall <=0.0)
     verySmall = 1.0E-5;
-  for(int i = 0; i < numLevels; i++) 
+  for(int i = 0; i < numLevels; i++)
     zoomLevelBreaks.push_back(verySmall*pow(zoomFactor, numLevels-i-1));
 }
 
@@ -90,8 +90,8 @@ int roundToInt(double x) {
   return (x>0.0) ? int(x+0.5) : int(x-0.5);
 }
 //------------------------------------------------------------------------
-void PolylineEncoder::createEncodings(string &encoded_points, 
-                                     const vector <LatLng> &points, 
+void PolylineEncoder::createEncodings(string &encoded_points,
+                                     const vector <LatLng> &points,
                                      const vector <double> dists)
 {
   encoded_points = "";;
@@ -111,7 +111,7 @@ void PolylineEncoder::createEncodings(string &encoded_points,
 }
 
 //------------------------------------------------------------------------
-// This computes the appropriate zoom level of a point in terms of it's 
+// This computes the appropriate zoom level of a point in terms of it's
 // distance from the relevant segment in the DP algorithm.  Could be done
 // in terms of a logarithm, but this approach makes it a bit easier to
 // ensure that the level is not too large.
@@ -202,9 +202,3 @@ void PolylineEncoder::dpEncode(string &encPts, string &encLevels, const vector<L
   createEncodings(encPts, points, dists);
   encodeLevels(encLevels, points, dists);
 }
-
-
-
-
-
-
index dfae9ab808d6cb86c14b2bc4e37afd3fb41d8ff2..b961f006cfc3a6cdb82078e5a072e83750e4842c 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: filterdata.cpp,v 1.2 2009/07/31 18:32:32 robertl Exp $
+// $Id: filterdata.cpp,v 1.3 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -90,7 +90,7 @@ QStringList TrackFilterData::makeOptionString()
   if (merge)    s += ",merge";
   if (split && (pack || merge))  {
     s += ",split";
-    if (splitTime > 0) 
+    if (splitTime > 0)
       s += QString("=%1%2").arg(splitTime).arg("mhd"[splitTimeUnit]);
   }
   if (splitDist > 0) {
@@ -116,7 +116,7 @@ QStringList TrackFilterData::makeOptionString()
   if (move)     s += QString(",move=%1d%2h%3m%4s").arg(days).arg(hours).arg(mins).arg(secs);
   if (title)    s += QString(",title=%1").arg(titleString);
 
-  if (s.length()) 
+  if (s.length())
     args << "-x" << "track" + s;
 
   return args;
@@ -160,5 +160,3 @@ QStringList MiscFltFilterData::makeOptionString()
   }
   return args;
 }
-
-
index 29a8437a9baa6225b1cfbb39d10b8875efae60d9..5983a042ffff1e3307eea63c9e954f8744a12bbf 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: filterdlg.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: filterdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -58,7 +58,7 @@ FilterDialog::FilterDialog(QWidget*parent, AllFiltersData &fd): QDialog(parent),
 
   connect(ui.helpButton, SIGNAL(clicked()), this, SLOT(helpX()));
   connect(ui.resetButton, SIGNAL(clicked()), this, SLOT(resetX()));
-  
+
 
   ui.buttonBox->button(QDialogButtonBox::Ok)->setIcon(QIcon(":images/ok"));
   ui.buttonBox->button(QDialogButtonBox::Cancel)->setIcon(QIcon(":images/cancel"));
@@ -71,7 +71,7 @@ FilterDialog::FilterDialog(QWidget*parent, AllFiltersData &fd): QDialog(parent),
 
 
 //------------------------------------------------------------------------
-void FilterDialog::addFilterPage(const QString &name, FilterWidget *fw, bool*use) 
+void FilterDialog::addFilterPage(const QString &name, FilterWidget *fw, bool*use)
 {
   QListWidgetItem *it = new QListWidgetItem(name);
   it->setCheckState(*use? Qt::Checked:Qt::Unchecked);
@@ -110,7 +110,7 @@ void FilterDialog::resetX()
       pages[i]->setWidgetValues();
       pages[i]->setEnabled(*(usePages[i]));
       pages[i]->checkChecks();
-      ui.filterList->item(i)->setCheckState(*(usePages[i]) ? Qt::Checked: Qt::Unchecked); 
+      ui.filterList->item(i)->setCheckState(*(usePages[i]) ? Qt::Checked: Qt::Unchecked);
     }
   }
 }
index 3faf009b61852b5e28c012b7d5469ccf92a86273..c142709a661bf6b60e4017a235c50cabd7de7bd4 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: filterwidgets.cpp,v 1.2 2009/07/31 18:32:32 robertl Exp $
+// $Id: filterwidgets.cpp,v 1.3 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -30,8 +30,8 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa
 
   // Checkbox interlocks
   addCheckEnabler(ui.titleCheck, ui.titleText);
-  addCheckEnabler(ui.moveCheck, 
-                 (QList<QWidget *> () 
+  addCheckEnabler(ui.moveCheck,
+                 (QList<QWidget *> ()
                   << ui.daysLabel << ui.daysSpin
                   << ui.hoursLabel<< ui.hoursSpin
                   << ui.minsLabel << ui.minsSpin
@@ -39,7 +39,7 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa
   addCheckEnabler(ui.startCheck,    ui.startEdit);
   addCheckEnabler(ui.stopCheck,     ui.stopEdit);
   addCheckEnabler(ui.GPSFixesCheck, ui.GPSFixesCombo);
-  
+
   connect(ui.mergeCheck, SIGNAL(clicked()) , this, SLOT(mergeCheckX()));
   connect(ui.splitCheck, SIGNAL(clicked()) , this, SLOT(OtherCheckX()));
   connect(ui.packCheck,  SIGNAL(clicked()),  this, SLOT(packCheckX()));
@@ -48,7 +48,7 @@ TrackWidget::TrackWidget(QWidget *parent, TrackFilterData &tfd): FilterWidget(pa
 
   ui.startEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP");
   ui.stopEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP");
-  
+
   // Collect the data fields.
   fopts << new BoolFilterOption(tfd.title,  ui.titleCheck);
   fopts << new BoolFilterOption(tfd.move,   ui.moveCheck);
@@ -88,7 +88,7 @@ void TrackWidget::OtherCheckX()
   bool bb = ui.packCheck->isChecked() &&ui.splitCheck->isChecked();
   ui.splitTimeSpin->setEnabled(bb);
   ui.splitTimeCombo->setEnabled(bb);
-  //ui.splitDistSpin->setEnabled(bb); 
+  //ui.splitDistSpin->setEnabled(bb);
   //ui.splitDistCombo->setEnabled(bb);
 }
 
index e377c744b7a57efc04a63f989b0381d0ce711207..f9fc6562f5975e36fdf1b6bb31b27f610c483672 100644 (file)
@@ -1,5 +1,5 @@
 // -*- c++ -*-
-// $Id: formatload.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: formatload.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -38,7 +38,7 @@ static QString xlt(const QString &f) {
 bool FormatLoad::skipToValidLine()
 {
   QRegExp regex("^(file|serial)");
-  while (currentLine <lines.size() && regex.indexIn(lines[currentLine]) != 0) 
+  while (currentLine <lines.size() && regex.indexIn(lines[currentLine]) != 0)
     currentLine++;
   return (currentLine<lines.size());
 }
@@ -73,16 +73,16 @@ bool FormatLoad::processFormat(Format &format)
       type = FormatOption::OPTstring;
     else if (optionType == "integer") {
       type = (optionMax != "" && optionMin != "") ? FormatOption::OPTboundedInt : FormatOption::OPTint;
-      if (optionMax == "") 
+      if (optionMax == "")
        optionMax = "2147483647";
-      if (optionMin == "") 
+      if (optionMin == "")
        optionMin = "-2147483647";
     }
     else if (optionType == "float") {
       type = FormatOption::OPTfloat;
-      if (optionMax == "") 
+      if (optionMax == "")
        optionMax = "1.0E308";
-      if (optionMin == "") 
+      if (optionMin == "")
        optionMin = "-1.0E308";
     }
     else if (optionType == "file") {
@@ -101,13 +101,13 @@ bool FormatLoad::processFormat(Format &format)
   }
   QList <FormatOption> optionList2 = optionList;
 
-  format = Format(hfields[2], xlt(hfields[4]), 
+  format = Format(hfields[2], xlt(hfields[4]),
                  hfields[1][0] == QChar('r'),  hfields[1][2] == QChar('r'),  hfields[1][4] == QChar('r'),
                  hfields[1][1] == QChar('w'),  hfields[1][3] == QChar('w'),  hfields[1][5] == QChar('w'),
                  hfields[0] == "file",
                  hfields[0] == "serial",
                  QStringList() << hfields[3],
-                 optionList,           
+                 optionList,
                  optionList2);
   return true;
 }
@@ -116,7 +116,7 @@ bool FormatLoad::processFormat(Format &format)
 bool FormatLoad::getFormats(QList<Format> &formatList)
 {
   formatList.clear();
-  
+
   QProcess babel;
   babel.start("gpsbabel", QStringList() << "-^3");
   if (!babel.waitForStarted())
@@ -124,7 +124,7 @@ bool FormatLoad::getFormats(QList<Format> &formatList)
   babel.closeWriteChannel();
   if (!babel.waitForFinished())
     return false;
-  if (babel.exitCode() != 0) 
+  if (babel.exitCode() != 0)
     return false;
 
   QTextStream tstream(babel.readAll());
@@ -144,13 +144,12 @@ bool FormatLoad::getFormats(QList<Format> &formatList)
     Format format;
     if (!processFormat(format)) {
       QMessageBox::information
-       (0, appName, 
+       (0, appName,
         QObject::tr("Error processing formats from running process \"gpsbabel -^3\" at line %1").arg(lineList[currentLine]));
-    } 
+    }
     else {
       formatList << format;
     }
   }
   return true;
 }
-
index 9549066134edd0740e6ef8c6c8a525116a41ee22..b3ac386fa2fb8278f22c087a31f8a21860719aeb 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: gmapdlg.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: gmapdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -42,14 +42,14 @@ class StandardItem: public QStandardItem
 class TreeAction: public QAction
 {
 public:
-  TreeAction(const QString &text, 
+  TreeAction(const QString &text,
             QObject *obj, const char *member,  QObject *parent): QAction(text, parent)
   {
     connect(this, SIGNAL(triggered()), obj, member);
   }
 };
 //------------------------------------------------------------------------
-QString GMapDialog::formatLength(double l) 
+QString GMapDialog::formatLength(double l)
 {
   double metricLength = l;
   QString metricUnit = tr("meters");
@@ -59,7 +59,7 @@ QString GMapDialog::formatLength(double l)
     metricUnit = "km";
     metricPrecision = 3;
   }
-  
+
   double fpsLength = l*1000.0/25.4/12.0;
   QString fpsUnit = tr("feet");
   int fpsPrecision = 1;
@@ -73,7 +73,7 @@ QString GMapDialog::formatLength(double l)
                 .arg(metricUnit)
                 .arg(fpsLength, 0, 'f', fpsPrecision)
                 .arg(fpsUnit));
-  
+
 }
 //------------------------------------------------------------------------
 void GMapDialog::appendWaypointInfo(QStandardItem *it, const GpxWaypoint &wpt)
@@ -84,7 +84,7 @@ void GMapDialog::appendWaypointInfo(QStandardItem *it, const GpxWaypoint &wpt)
     it->appendRow(new StandardItem(tr("Desc: %1").arg(wpt.getDescription())));
   if (wpt.getComment() != QString() && wpt.getComment() != wpt.getDescription())
     it->appendRow(new StandardItem(tr("Cmt: %1").arg(wpt.getComment())));
-  if (wpt.getElevation() > -50000) 
+  if (wpt.getElevation() > -50000)
     it->appendRow(new StandardItem(tr("Ele: %1").arg(wpt.getElevation())));
 
 }
@@ -123,7 +123,7 @@ void GMapDialog::appendTrackInfo(QStandardItem *it, const GpxTrack &trk)
   it->appendRow(new StandardItem(tr("Points: %1").arg(count)));
 
   it->appendRow(new StandardItem(formatLength(trk.length())));
-  
+
 }
 
 //------------------------------------------------------------------------
@@ -145,7 +145,7 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd
   lay->addWidget(mapWidget);
 
   model = new QStandardItemModel(this);
-  
+
   wptItem = new StandardItem(tr("Waypoints"));
   wptItem->setCheckable(true);
   wptItem->setCheckState(Qt::Checked);
@@ -199,7 +199,7 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd
   connect(mapWidget, SIGNAL(waypointClicked(int)), this, SLOT(waypointClickedX(int)));
   connect(mapWidget, SIGNAL(routeClicked(int)), this, SLOT(routeClickedX(int)));
   connect(mapWidget, SIGNAL(trackClicked(int)), this, SLOT(trackClickedX(int)));
-  connect(ui.treeView, SIGNAL(doubleClicked(const QModelIndex &)), 
+  connect(ui.treeView, SIGNAL(doubleClicked(const QModelIndex &)),
          this, SLOT(treeDoubleClicked(const QModelIndex&)));
   connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged (const QItemSelection &,  const QItemSelection &)),
          this, SLOT(selectionChangedX(const QItemSelection &,  const QItemSelection &)));
@@ -212,27 +212,27 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::itemChangedX(QStandardItem *it) 
+void GMapDialog::itemChangedX(QStandardItem *it)
 {
   bool show = (it->checkState() == Qt::Checked);
   if (it == trkItem) {
-    if (show) 
+    if (show)
       mapWidget->showTracks(gpx.getTracks());
-    else 
+    else
       mapWidget->hideAllTracks();
   }
 
   else if (it == wptItem) {
     if (show)
       mapWidget->showWaypoints(gpx.getWaypoints());
-    else 
+    else
       mapWidget->hideAllWaypoints();
   }
 
   else if (it == rteItem) {
     if (show)
       mapWidget->showRoutes(gpx.getRoutes());
-    else 
+    else
       mapWidget->hideAllRoutes();
   }
 
@@ -258,13 +258,13 @@ void GMapDialog::itemChangedX(QStandardItem *it)
       }
     }
   }
-}  
+}
 
 //-------------------------------------------------------------------------
 int GMapDialog::waypointIndex(QStandardItem *it)
 {
   for (int j=0; j<wptList.size(); j++){
-    if (it == wptList[j]) 
+    if (it == wptList[j])
       return j;
   }
   return -1;
@@ -274,7 +274,7 @@ int GMapDialog::waypointIndex(QStandardItem *it)
 int GMapDialog::trackIndex(QStandardItem *it)
 {
   for (int j=0; j<trkList.size(); j++){
-    if (it == trkList[j]) 
+    if (it == trkList[j])
       return j;
   }
   return -1;
@@ -284,14 +284,14 @@ int GMapDialog::trackIndex(QStandardItem *it)
 int GMapDialog::routeIndex(QStandardItem *it)
 {
   for (int j=0; j<rteList.size(); j++){
-    if (it == rteList[j]) 
+    if (it == rteList[j])
       return j;
   }
   return -1;
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::treeDoubleClicked(const QModelIndex &idx) 
+void GMapDialog::treeDoubleClicked(const QModelIndex &idx)
 {
   QStandardItem *it = model->itemFromIndex(idx);
   int i = waypointIndex(it);
@@ -321,7 +321,7 @@ void GMapDialog::treeDoubleClicked(const QModelIndex &idx)
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::waypointClickedX(int i) 
+void GMapDialog::waypointClickedX(int i)
 {
   if (i>=0 && i < wptList.size()) {
     QStandardItem *it = wptList[i];
@@ -331,7 +331,7 @@ void GMapDialog::waypointClickedX(int i)
   }
 }
 //-------------------------------------------------------------------------
-void GMapDialog::trackClickedX(int i) 
+void GMapDialog::trackClickedX(int i)
 {
   if (i>=0 && i <trkList.size()) {
     QStandardItem *it = trkList[i];
@@ -342,7 +342,7 @@ void GMapDialog::trackClickedX(int i)
 }
 
 //-------------------------------------------------------------------------
-void GMapDialog::routeClickedX(int i) 
+void GMapDialog::routeClickedX(int i)
 {
   if (i>=0 && i <rteList.size()) {
     QStandardItem *it = rteList[i];
@@ -358,16 +358,16 @@ void GMapDialog::selectionChangedX (const QItemSelection &sel,  const QItemSelec
   int k=0;
   foreach (QStandardItem*w, wptList) {
     QModelIndex idx = model->indexFromItem(w);
-    if (desel.contains(idx)) 
+    if (desel.contains(idx))
       mapWidget->setWaypointColorBlue(k);
-    if (sel.contains(idx)) 
+    if (sel.contains(idx))
       mapWidget->setWaypointColorRed(k);
     k++;
   }
 }
 
 //------------------------------------------------------------------------
-void GMapDialog::expandCollapseAll(const QList<QStandardItem *> &li, 
+void GMapDialog::expandCollapseAll(const QList<QStandardItem *> &li,
                                   QStandardItem *top, bool exp)
 {
   ui.treeView->setExpanded(model->indexFromItem(top), exp);
@@ -410,7 +410,7 @@ void GMapDialog::collapseAllRoutes()
 }
 
 //------------------------------------------------------------------------
-void GMapDialog::checkUncheckAll(const QList<QStandardItem *> &li, 
+void GMapDialog::checkUncheckAll(const QList<QStandardItem *> &li,
                                   QStandardItem *top, bool ck)
 {
   top->setCheckState(ck ? Qt::Checked: Qt::Unchecked);
@@ -421,7 +421,7 @@ void GMapDialog::checkUncheckAll(const QList<QStandardItem *> &li,
 //------------------------------------------------------------------------
 void GMapDialog::showAllWaypoints()
 {
-  foreach (GpxWaypoint wpt, gpx.getWaypoints()) 
+  foreach (GpxWaypoint wpt, gpx.getWaypoints())
     wpt.setVisible(true);
   checkUncheckAll(wptList, wptItem, true);
   mapWidget->showWaypoints(gpx.getWaypoints());
@@ -429,7 +429,7 @@ void GMapDialog::showAllWaypoints()
 //------------------------------------------------------------------------
 void GMapDialog::showAllTracks()
 {
-  foreach (GpxTrack trk, gpx.getTracks()) 
+  foreach (GpxTrack trk, gpx.getTracks())
     trk.setVisible(true);
   checkUncheckAll(trkList, trkItem, true);
   mapWidget->showTracks(gpx.getTracks());
@@ -438,7 +438,7 @@ void GMapDialog::showAllTracks()
 //------------------------------------------------------------------------
 void GMapDialog::showAllRoutes()
 {
-  foreach (GpxRoute rte, gpx.getRoutes()) 
+  foreach (GpxRoute rte, gpx.getRoutes())
     rte.setVisible(true);
   checkUncheckAll(rteList, rteItem, true);
   mapWidget->showRoutes(gpx.getRoutes());
@@ -447,7 +447,7 @@ void GMapDialog::showAllRoutes()
 //------------------------------------------------------------------------
 void GMapDialog::hideAllWaypoints()
 {
-  foreach (GpxWaypoint wpt, gpx.getWaypoints()) 
+  foreach (GpxWaypoint wpt, gpx.getWaypoints())
     wpt.setVisible(false);
   checkUncheckAll(wptList, wptItem, false);
   mapWidget->showWaypoints(gpx.getWaypoints());
@@ -455,7 +455,7 @@ void GMapDialog::hideAllWaypoints()
 //------------------------------------------------------------------------
 void GMapDialog::hideAllTracks()
 {
-  foreach (GpxTrack trk, gpx.getTracks()) 
+  foreach (GpxTrack trk, gpx.getTracks())
     trk.setVisible(false);
   checkUncheckAll(trkList, trkItem, false);
   mapWidget->showTracks(gpx.getTracks());
@@ -464,7 +464,7 @@ void GMapDialog::hideAllTracks()
 //------------------------------------------------------------------------
 void GMapDialog::hideAllRoutes()
 {
-  foreach (GpxRoute rte, gpx.getRoutes()) 
+  foreach (GpxRoute rte, gpx.getRoutes())
     rte.setVisible(false);
   checkUncheckAll(rteList, rteItem, false);
   mapWidget->showRoutes(gpx.getRoutes());
@@ -508,7 +508,7 @@ void GMapDialog::showOnlyThisRoute()
 }
 
 //------------------------------------------------------------------------
-void GMapDialog::showContextMenu(const QPoint &pt) 
+void GMapDialog::showContextMenu(const QPoint &pt)
 {
   QModelIndex idx = ui.treeView->indexAt(pt);
   QStandardItem *it = model->itemFromIndex(idx);
@@ -558,4 +558,3 @@ void GMapDialog::showContextMenu(const QPoint &pt)
   else {
   }
 }
-
index 2fc8243f657dcf832d2fb52470f6e2d5be612a64..8204d6bf0fb2a59f4e0f8b5cb78771151b13dc0c 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: gpx.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: gpx.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -29,7 +29,7 @@
 #include "gpx.h"
 
 
-static QDateTime decodeDateTime(const QString s) 
+static QDateTime decodeDateTime(const QString s)
 {
   QDateTime utc = QDateTime::fromString(s, "yyyy-MM-dd'T'HH:mm:ss'Z'");
   return utc;
@@ -45,10 +45,10 @@ static bool trackIsEmpty(const GpxTrack &trk){
   return count <=2 ;
 }
 
-class GpxHandler: public QXmlDefaultHandler 
+class GpxHandler: public QXmlDefaultHandler
 {
-public: 
-  GpxHandler(): QXmlDefaultHandler() 
+public:
+  GpxHandler(): QXmlDefaultHandler()
 
   {
     state = e_noop;
@@ -122,12 +122,12 @@ public:
     }
 
 
-    else if (state == e_wpt || 
+    else if (state == e_wpt ||
             state == e_trkpt || state == e_trkseg || state == e_trk ||
             state == e_rte || state == e_rtept) {
     }
     else {
-      //fprintf(stderr, "localName:  %s     name:  %s\n", 
+      //fprintf(stderr, "localName:  %s     name:  %s\n",
       //localName.toStdString().c_str(), qName.toStdString().c_str());
     }
     return true;
@@ -175,7 +175,7 @@ public:
 
     else if (localName == "trk") {
       state = stateStack.takeLast();
-      if (!trackIsEmpty(currentTrk)) 
+      if (!trackIsEmpty(currentTrk))
        trkList << currentTrk;
     }
 
@@ -206,7 +206,7 @@ public:
     }
 
     else {
-      //fprintf(stderr, "end ---- localName:  %s     name:  %s\n\n", 
+      //fprintf(stderr, "end ---- localName:  %s     name:  %s\n\n",
       //localName.toStdString().c_str(), qName.toStdString().c_str());
     }
     return true;
@@ -225,7 +225,7 @@ public:
 bool Gpx::read(const QString & fileName)
 {
   QFile file(fileName);
-  if (!file.open(QIODevice::ReadOnly)) 
+  if (!file.open(QIODevice::ReadOnly))
     return false;
 
   QXmlInputSource xmlIn(&file);
@@ -240,8 +240,6 @@ bool Gpx::read(const QString & fileName)
     routes = gpxHandler.rteList;
     return true;
   }
-  else 
+  else
     return false;
 }
-
-
index 6e621e307a20f78cca25277959a380bc02f76c7f..da31c38d30d23911797830f89111138983739685 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: help.cpp,v 1.3 2009/07/27 04:04:42 robertl Exp $
+// $Id: help.cpp,v 1.4 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -28,7 +28,7 @@
 //------------------------------------------------------------------------
 void ShowHelp(const char *name)
 {
-  QUrl urlname("file://" + QApplication::applicationDirPath() + 
+  QUrl urlname("file://" + QApplication::applicationDirPath() +
                 "/help/" + name);
   // FIXME(robertl): This shoud probably parent from QApplication::mainWidget();
   QWebView *view = new QWebView();
@@ -36,4 +36,3 @@ void ShowHelp(const char *name)
   view->load(urlname);
   view->show();
 }
-
index 64e099740a261a6b4cf99ac6d6a02938d9913db6..e27f2c2e2e7c4fa73f52806d6416911217e94cbd 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: latlng.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: latlng.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -43,7 +43,7 @@ static const double EARTH_RADIUS_IN_METERS = 6372797.560856;
   *
   * @sa http://en.wikipedia.org/wiki/Law_of_haversines
   */
-static double ArcInRadians(const LatLng& from, const LatLng& to) 
+static double ArcInRadians(const LatLng& from, const LatLng& to)
 {
   double latitudeArc  = (from.lat() - to.lat()) * DEG_TO_RAD;
   double longitudeArc = (from.lng() - to.lng()) * DEG_TO_RAD;
index a20bb8bde1b9c4ddfd1ece7a6d81d92154c6ad52..9e52989b153a8bdf4d9874817f84f12afc948ce9 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: main.cpp,v 1.3 2009/07/23 03:22:24 robertl Exp $
+// $Id: main.cpp,v 1.4 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -63,7 +63,7 @@ int main(int argc, char**argv)
   installTranslation(app, "qt_");
   installTranslation(app, "gpsbabelfe_");
   installTranslation(app, "gpsbabel_");
-  
+
   QCoreApplication::setOrganizationName("GPSBabel");
   QCoreApplication::setOrganizationDomain("gpsbabel.org");
   QCoreApplication::setApplicationName("GPSBabelFE");
@@ -72,4 +72,3 @@ int main(int argc, char**argv)
   mainWindow.show();
   app->exec();
 }
-
index 80a265e9ded4c9e2a1e1ed2f56b91b9ef7c8d114..7971fe6e84ce7f05c0a6e281c04442097c6db5c6 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.4 2009/08/06 03:19:10 robertl Exp $
+// $Id: mainwindow.cpp,v 1.5 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -103,7 +103,7 @@ static QStringList getCharSets()
 }
 
 //------------------------------------------------------------------------
-static QString MakeOptions(const QList<FormatOption>& options) 
+static QString MakeOptions(const QList<FormatOption>& options)
 {
   QString str;
   for (int i=0; i<options.size(); i++) {
@@ -119,11 +119,11 @@ static QString MakeOptions(const QList<FormatOption>& options)
 }
 
 //------------------------------------------------------------------------
-static QString MakeOptionsNoLeadingComma(const QList<FormatOption>& options) 
+static QString MakeOptionsNoLeadingComma(const QList<FormatOption>& options)
 {
   QString str = MakeOptions(options);
   return (str.length()) ? str.mid(1) : str;
-    
+
 }
 //------------------------------------------------------------------------
 MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
@@ -181,7 +181,7 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
   lights[1] = QPixmap::fromImage(QImage(":images/01.png").scaledToHeight(20, Qt::SmoothTransformation));
   lights[2] = QPixmap::fromImage(QImage(":images/10.png").scaledToHeight(20, Qt::SmoothTransformation));
   lights[3] = QPixmap::fromImage(QImage(":images/11.png").scaledToHeight(20, Qt::SmoothTransformation));
-  
+
   ui.outputWindow->setReadOnly(true);
 
 
@@ -254,7 +254,7 @@ void MainWindow::inputFileOptBtnClicked()
 }
 
 //------------------------------------------------------------------------
-void MainWindow::inputDeviceOptBtnClicked() 
+void MainWindow::inputDeviceOptBtnClicked()
 {
   fmtChgInterlock = true;
   QString fmt = bd.inputDeviceFormat;
@@ -285,7 +285,7 @@ void MainWindow:: outputFileOptBtnClicked()
       ui.outputFormatCombo->addItem(formatList[k].getDescription(), QVariant(k));
     }
     setComboToFormat(ui.outputFormatCombo, fmt, true);
-  } 
+  }
   else {
     ui.outputStackedWidget->setCurrentWidget(ui.outputFilePage);
     ui.outputFilePage->setEnabled(false);
@@ -363,17 +363,17 @@ void MainWindow::browseInputFile()
   if (!finfo.isDir() && (!filterForFormatIncludes(idx, finfo.suffix()))) {
     startFile = finfo.dir().absolutePath();
   }
-  QStringList userList = 
+
+  QStringList userList =
     QFileDialog::getOpenFileNames(0, tr("Select one or more input files"),
-                                 startFile, 
+                                 startFile,
                                  filterForFormat(idx));
   if (userList.size()) {
     bd.inputBrowse = userList[0];
     bd.inputFileNames = userList;
     QString str;
     for (int i=0; i<bd.inputFileNames.size(); i++) {
-      if (i != 0) 
+      if (i != 0)
        str += ", ";
       str += "\"" + bd.inputFileNames[i] + "\"";
     }
@@ -390,10 +390,10 @@ void MainWindow::browseOutputFile()
   if (!finfo.isDir() && (!filterForFormatIncludes(idx, finfo.suffix()))) {
     startFile = finfo.dir().absolutePath();
   }
+
   QString str =
     QFileDialog::getSaveFileName(0, tr("Output File Name"),
-                                startFile, 
+                                startFile,
                                 filterForFormat(idx));
   if (str.length() != 0) {
     bd.outputBrowse = str;
@@ -407,7 +407,7 @@ QList<int> MainWindow::inputFileFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isReadSomething() && formatList[i].isFileFormat()) 
+    if (formatList[i].isReadSomething() && formatList[i].isFileFormat())
       indices<<i;
   }
   return indices;
@@ -418,7 +418,7 @@ QList<int> MainWindow::inputDeviceFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isReadSomething() && formatList[i].isDeviceFormat()) 
+    if (formatList[i].isReadSomething() && formatList[i].isDeviceFormat())
       indices<<i;
   }
   return indices;
@@ -429,7 +429,7 @@ QList<int> MainWindow::outputFileFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isWriteSomething() && formatList[i].isFileFormat()) 
+    if (formatList[i].isWriteSomething() && formatList[i].isFileFormat())
       indices<<i;
   }
   return indices;
@@ -440,7 +440,7 @@ QList<int> MainWindow::outputDeviceFormatIndices()
 {
   QList<int>indices;
   for (int i=0; i<formatList.size(); i++) {
-    if (formatList[i].isWriteSomething() && formatList[i].isDeviceFormat()) 
+    if (formatList[i].isWriteSomething() && formatList[i].isDeviceFormat())
       indices<<i;
   }
   return indices;
@@ -450,7 +450,7 @@ QList<int> MainWindow::outputDeviceFormatIndices()
 void MainWindow::loadFormats()
 {
   if (!FormatLoad().getFormats(formatList)) {
-    QMessageBox::information(0, QString(appName), 
+    QMessageBox::information(0, QString(appName),
                             tr("Error reading format configuration.  "
                                "Check that the backend program \"gpsbabel\" is properly installed "
                                "and is in the current PATH\n\n"
@@ -461,7 +461,7 @@ void MainWindow::loadFormats()
       inputDeviceFormatIndices().size() == 0 ||
       outputFileFormatIndices().size() == 0 ||
       outputDeviceFormatIndices().size() == 0) {
-    QMessageBox::information(0, QString(appName), 
+    QMessageBox::information(0, QString(appName),
                             tr("Some file/device formats were not found during initialization.  "
                                "Check that the backend program \"gpsbabel\" is properly installed "
                                "and is in the current PATH\n\n"
@@ -476,11 +476,11 @@ static int iconIndex(bool a, bool b)
 }
 
 //------------------------------------------------------------------------
-void MainWindow::setIndicatorLights(QLabel *label, const QString type, int code) 
+void MainWindow::setIndicatorLights(QLabel *label, const QString type, int code)
 {
   label->setPixmap(lights[code]);
   QString s;
-  switch (code) 
+  switch (code)
     {
     default:
     case 0:
@@ -509,23 +509,23 @@ void MainWindow::crossCheckInOutFormats()
   }
   Format ifmt = formatList[currentComboFormatIndex(ui.inputFormatCombo)];
   Format ofmt = formatList[currentComboFormatIndex(ui.outputFormatCombo)];
-  
+
   ui.xlateWayPtsCk->setEnabled(ifmt.isReadWaypoints() && ofmt.isWriteWaypoints());
   ui.xlateTracksCk->setEnabled(ifmt.isReadTracks()    && ofmt.isWriteTracks());
   ui.xlateRoutesCk->setEnabled(ifmt.isReadRoutes()    && ofmt.isWriteRoutes());
-  
+
   setIndicatorLights(ui.wayPtLabel, tr("waypoints"), iconIndex(ifmt.isReadWaypoints(), ofmt.isWriteWaypoints()));
   setIndicatorLights(ui.trackLabel, tr("tracks"), iconIndex(ifmt.isReadTracks(), ofmt.isWriteTracks()));
   setIndicatorLights(ui.routeLabel, tr("routes"), iconIndex(ifmt.isReadRoutes(), ofmt.isWriteRoutes()));
 }
 
 //------------------------------------------------------------------------
-void MainWindow::displayOptionsText(QLineEdit *le, QComboBox *combo, bool isInput) 
+void MainWindow::displayOptionsText(QLineEdit *le, QComboBox *combo, bool isInput)
 {
   int fidx = combo->itemData(combo->currentIndex()).toInt();
   if (isInput)
     le->setText(MakeOptionsNoLeadingComma(formatList[fidx].getInputOptions()));
-  else 
+  else
     le->setText(MakeOptionsNoLeadingComma(formatList[fidx].getOutputOptions()));
 
 }
@@ -552,7 +552,7 @@ void MainWindow::setComboToFormat(QComboBox *comboBox, const QString &name, bool
 }
 
 //------------------------------------------------------------------------
-void MainWindow::inputFormatChanged(int comboIdx) 
+void MainWindow::inputFormatChanged(int comboIdx)
 {
   if (fmtChgInterlock)
     return;
@@ -568,7 +568,7 @@ void MainWindow::inputFormatChanged(int comboIdx)
 }
 
 //------------------------------------------------------------------------
-void MainWindow::outputFormatChanged(int comboIdx) 
+void MainWindow::outputFormatChanged(int comboIdx)
 {
   if (fmtChgInterlock)
     return;
@@ -585,10 +585,10 @@ void MainWindow::outputFormatChanged(int comboIdx)
 }
 
 //------------------------------------------------------------------------
-void MainWindow::inputOptionButtonClicked() 
+void MainWindow::inputOptionButtonClicked()
 {
   int fidx = currentComboFormatIndex(ui.inputFormatCombo);
-  OptionsDlg optionDlg(0, 
+  OptionsDlg optionDlg(0,
                       formatList[fidx].getName(),
                       formatList[fidx].getInputOptionsRef());
   optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName()));
@@ -597,7 +597,7 @@ void MainWindow::inputOptionButtonClicked()
 }
 
 //------------------------------------------------------------------------
-void MainWindow::outputOptionButtonClicked() 
+void MainWindow::outputOptionButtonClicked()
 {
   int fidx = currentComboFormatIndex(ui.outputFormatCombo);
   OptionsDlg optionDlg(0, formatList[fidx].getName(), formatList[fidx].getOutputOptionsRef());
@@ -616,7 +616,7 @@ bool MainWindow::isOkToGo()
     QMessageBox::information(0, QString(appName), tr("No valid waypoints/routes/tracks translation specified"));
     return false;
   }
-  
+
   if ((bd.inputType == BabelData::fileType) &&
       (bd.inputFileNames.size() == 0)) {
     QMessageBox::information(0, QString(appName), tr("No input file specified"));
@@ -629,7 +629,7 @@ bool MainWindow::isOkToGo()
     QMessageBox::information(0, QString(appName), tr("No valid output specified"));
     return false;
   }
-  else if (bd.outputType == BabelData::fileType && 
+  else if (bd.outputType == BabelData::fileType &&
           bd.outputFileName.length() == 0) {
     QMessageBox::information(0, QString(appName), tr("No output file specified"));
     return false;
@@ -638,7 +638,7 @@ bool MainWindow::isOkToGo()
 }
 
 //------------------------------------------------------------------------
-bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString, 
+bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString,
                          QString &outputString)
 {
   QProcess *proc = new QProcess(0);
@@ -650,7 +650,7 @@ bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString,
     errorString = QString(tr("Process \"%1\" did not start")).arg(name);
     return false;
   }
-  
+
   waitDlg->show();
   waitDlg->exec();
   int exitCode = -1;
@@ -660,7 +660,7 @@ bool MainWindow::runGpsbabel(const QStringList &args, QString &errorString,
     if (exitCode == 0)
       retStatus = true;
     else  {
-      errorString = 
+      errorString =
        QString(tr("Process exited unsucessfully with code %1"))
        .arg(exitCode);
       retStatus = false;
@@ -703,7 +703,7 @@ void MainWindow::setComboToCharSet(QComboBox *combo, const QString &cset)
   }
 }
 //------------------------------------------------------------------------
-void MainWindow::applyActionX() 
+void MainWindow::applyActionX()
 {
   getWidgetValues();
   if (!isOkToGo())
@@ -715,7 +715,7 @@ void MainWindow::applyActionX()
   if (bd.synthShortNames)    args << "-s";
 
   // Input char set if specified
-  if (bd.enableCharSetXform && bd.inputCharSet != QString()) 
+  if (bd.enableCharSetXform && bd.inputCharSet != QString())
     args << "-c" << bd.inputCharSet;
 
   if (bd.xlateWayPts)        args << "-w";
@@ -728,10 +728,10 @@ void MainWindow::applyActionX()
                                 bd.inputFileFormat : bd.inputDeviceFormat);
   args << "-i";
   args << (formatList[fidx].getName() + MakeOptions(formatList[fidx].getInputOptions()));
-  
+
   // Input file(s) or device
   if (bd.inputType == BabelData::fileType) {
-    for (int i=0; i<bd.inputFileNames.size(); i++) 
+    for (int i=0; i<bd.inputFileNames.size(); i++)
       args << "-f" << bd.inputFileNames[i];
   }
   else {
@@ -742,7 +742,7 @@ void MainWindow::applyActionX()
   args << filterData.getAllFilterStrings();
 
   // Output char set if specified
-  if (bd.enableCharSetXform && bd.outputCharSet != QString()) 
+  if (bd.enableCharSetXform && bd.outputCharSet != QString())
     args << "-c" << bd.outputCharSet;
 
   // Output type, with options
@@ -752,7 +752,7 @@ void MainWindow::applyActionX()
                                           bd.outputFileFormat : bd.outputDeviceFormat));
     args << "-o";
     args << (formatList[fidx].getName() + MakeOptions(formatList[fidx].getOutputOptions()));
-    
+
     // output file or device option
     if (outIsFile) {
       if (bd.outputFileName != "")
@@ -800,12 +800,12 @@ void MainWindow::applyActionX()
       this->show();
     }
   }
-  else 
+  else
     ui.outputWindow->appendPlainText(tr("Error running gpsbabel: %1\n").arg(errorString));
 }
 
 //------------------------------------------------------------------------
-void MainWindow::closeActionX() 
+void MainWindow::closeActionX()
 {
   QDateTime wt= upgrade->getUpgradeWarningTime();
   if (wt.isValid()) {
@@ -818,7 +818,7 @@ void MainWindow::closeActionX()
 }
 
 //------------------------------------------------------------------------
-void MainWindow::closeEvent(QCloseEvent*)  
+void MainWindow::closeEvent(QCloseEvent*)
 {
   closeActionX();
 }
@@ -840,7 +840,7 @@ void MainWindow::saveSettings()
 
   QSettings settings;
   bd.saveSettings(settings);
-  for (int i=0; i<formatList.size(); i++) 
+  for (int i=0; i<formatList.size(); i++)
     formatList[i].saveSettings(settings);
   for (int i=0; i<filterData.filters.size(); i++)
     filterData.filters[i]->saveSettings(settings);
@@ -851,7 +851,7 @@ void MainWindow::restoreSettings()
 {
   QSettings settings;
   bd.restoreSettings(settings);
-  for (int i=0; i<formatList.size(); i++) 
+  for (int i=0; i<formatList.size(); i++)
     formatList[i].restoreSettings(settings);
 
   for (int i=0; i<filterData.filters.size(); i++)
@@ -868,7 +868,7 @@ void MainWindow::resetFormatDefaults()
      tr("Are you sure you want to reset all format options to default values?"),
      QMessageBox::Yes | QMessageBox::No);
   if (ret == QMessageBox::Yes) {
-    for (int i=0; i<formatList.size(); i++) 
+    for (int i=0; i<formatList.size(); i++)
       formatList[i].setToDefault();
     displayOptionsText(ui.inputOptionsText,  ui.inputFormatCombo, true);
     displayOptionsText(ui.outputOptionsText,  ui.outputFormatCombo, false);
@@ -878,7 +878,7 @@ void MainWindow::resetFormatDefaults()
 //------------------------------------------------------------------------
 void MainWindow::moreOptionButtonClicked()
 {
-  AdvDlg advDlg(0, bd.synthShortNames, 
+  AdvDlg advDlg(0, bd.synthShortNames,
                bd.forceGPSTypes, bd.enableCharSetXform, bd.previewGmap, bd.debugLevel);
   connect(advDlg.formatButton(), SIGNAL(clicked()),
          this, SLOT(resetFormatDefaults()));
@@ -912,7 +912,7 @@ void MainWindow::updateFilterStatus()
 {
   bool filterActive = filterData.getAllFilterStrings().size();
   ui.filterStatus->setEnabled(filterActive);
-  if (filterActive) 
+  if (filterActive)
     ui.filterStatus->setToolTip(tr("One or more data filters are active"));
   else {
     ui.filterStatus->setToolTip(tr("No data filters are active"));
@@ -1007,5 +1007,3 @@ void MainWindow::getWidgetValues()
   bd.xlateTracks = ui.xlateTracksCk->isChecked();
   bd.xlateRoutes = ui.xlateRoutesCk->isChecked();
 }
-
-
index c162a5c01e26dae25880fe131d664e319bfb07ae..04974e86130086998af6b40bc9aeea4aee7815ec 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.h,v 1.3 2009/08/06 03:19:10 robertl Exp $
+// $Id: mainwindow.h,v 1.4 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -31,7 +31,7 @@
 class MainWindow: public QMainWindow {
   Q_OBJECT
 
-  
+
   public:
   MainWindow(QWidget* parent);
   ~MainWindow();
index fd5f2dd02e75fbeb7747d1d9960295e4b64d6443..d0070178d676b34e936ee9c9284946f9eef03de1 100755 (executable)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: map.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: map.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -45,12 +45,12 @@ static QString stripDoubleQuotes(const QString s) {
 }
 
 //------------------------------------------------------------------------
-Map::Map(QWidget *parent, 
+Map::Map(QWidget *parent,
         const Gpx  &gpx, QPlainTextEdit *te):
-    QWebView(parent), 
+    QWebView(parent),
     gpx(gpx),
     mapPresent(false),
-    busyCursor(false), 
+    busyCursor(false),
     te(te)
 {
   busyCursor = true;
@@ -59,7 +59,7 @@ Map::Map(QWidget *parent,
   manager = new QNetworkAccessManager(this);
   connect(this,SIGNAL(loadFinished(bool)),
          this,SLOT(loadFinishedX(bool)));
-  this->logTimeX("Start map constuctor"); 
+  this->logTimeX("Start map constuctor");
   QString baseFile =  QApplication::applicationDirPath() + "/gmapbase.html";
   if (!QFile(baseFile).exists()) {
     QMessageBox::critical(0, appName,
@@ -80,8 +80,8 @@ Map::~Map()
 //------------------------------------------------------------------------
 void Map::loadFinishedX(bool f)
 {
-  this->logTimeX("Done initial page load"); 
-  if (!f) 
+  this->logTimeX("Done initial page load");
+  if (!f)
     QMessageBox::critical(0, appName,
                          tr("Failed to load Google maps base page"));
   else {
@@ -132,7 +132,7 @@ void Map::showGpxData()
   // It is appreciably faster to do the encoding on the C++ side.
   int numLevels = 18;
   double zoomFactor = 2;
-  PolylineEncoder encoder(numLevels, zoomFactor, 0.00001); 
+  PolylineEncoder encoder(numLevels, zoomFactor, 0.00001);
 
 
   this->logTimeX("Start defining JS string");
@@ -158,11 +158,11 @@ void Map::showGpxData()
     ;
 
   mapPresent = true;
-  
+
   // Waypoints.
   int num=0;
   foreach (const  GpxWaypoint &pt, gpx.getWaypoints() ) {
-    scriptStr 
+    scriptStr
       << QString("waypts[%1] = new GMarker(new GLatLng(%2), "
                 "{title:\"%3\",icon:blueIcon});")
       .arg(num)
@@ -193,7 +193,7 @@ void Map::showGpxData()
     string encPts, encLevels;
     encoder.dpEncode(encPts, encLevels, epts);
 
-    scriptStr 
+    scriptStr
       << QString("var startPt = new GLatLng(%1);").arg(fmtLatLng(epts[0]))
       << QString("var endPt = new GLatLng(%1);").arg(fmtLatLng(epts[epts.size()-1]))
       << QString("var idx = %1;").arg(num)
@@ -210,7 +210,7 @@ void Map::showGpxData()
 
   scriptStr
     << "for( var i=0; i<trks.length; ++i ) {"
-    << "   var trkbound = trks[i].getBounds();" 
+    << "   var trkbound = trks[i].getBounds();"
     << "   bounds.extend(trkbound.getSouthWest());"
     << "   bounds.extend(trkbound.getNorthEast());"
     << "}"
@@ -226,7 +226,7 @@ void Map::showGpxData()
     }
     string encPts, encLevels;
     encoder.dpEncode(encPts, encLevels, epts);
-    scriptStr 
+    scriptStr
       << QString("var startPt = new GLatLng(%1);").arg(fmtLatLng(epts[0]))
       << QString("var endPt = new GLatLng(%1);").arg(fmtLatLng(epts[epts.size()-1]))
       << QString("var idx = %1;").arg(num)
@@ -242,7 +242,7 @@ void Map::showGpxData()
 
   scriptStr
     << "for( var i=0; i<rtes.length; ++i ) {"
-    << "   var rtebound = rtes[i].getBounds();" 
+    << "   var rtebound = rtes[i].getBounds();"
     << "   bounds.extend(rtebound.getSouthWest());"
     << "   bounds.extend(rtebound.getNorthEast());"
     << "}"
@@ -253,7 +253,7 @@ void Map::showGpxData()
     << "map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));"
     << "mclicker.logTime(\"done setCenter\");"
     ;
-  
+
   this->logTimeX("Done defining JS string");
   evaluateJS(scriptStr);
   this->logTimeX("Done JS evaluation");
@@ -261,11 +261,11 @@ void Map::showGpxData()
 
 //------------------------------------------------------------------------
 void Map::markerClicked(int t, int i){
-  if (t == 0) 
+  if (t == 0)
     emit waypointClicked(i);
-  else if (t == 1) 
+  else if (t == 1)
     emit trackClicked(i);
-  else if (t == 2) 
+  else if (t == 2)
     emit routeClicked(i);
 
 }
@@ -359,7 +359,7 @@ void Map::setTrackVisibility(int i, bool show)
 {
   QString x = show?"show": "hide";
   QStringList scriptStr;
-  scriptStr 
+  scriptStr
     << QString("trks[%1].%2();").arg(i).arg(x)
     ;
   evaluateJS(scriptStr);
@@ -370,7 +370,7 @@ void Map::setRouteVisibility(int i, bool show)
 {
   QString x = show?"show": "hide";
   QStringList scriptStr;
-  scriptStr 
+  scriptStr
     << QString("rtes[%1].%2();").arg(i).arg(x)
     ;
   evaluateJS(scriptStr);
@@ -386,7 +386,7 @@ void Map::panTo(const LatLng &loc)
 void Map::resizeEvent ( QResizeEvent * ev)
 {
   QWebView::resizeEvent(ev);
-  if (mapPresent) 
+  if (mapPresent)
     evaluateJS(QString("map.checkResize();"));
 }
 
@@ -427,7 +427,7 @@ void Map::frameRoute(int i)
 
 
 //------------------------------------------------------------------------
-void Map::evaluateJS(const QString &s, bool upd) 
+void Map::evaluateJS(const QString &s, bool upd)
 {
   this->page()->mainFrame()->evaluateJavaScript(s);
   if (upd) {
@@ -436,7 +436,7 @@ void Map::evaluateJS(const QString &s, bool upd)
 }
 
 //------------------------------------------------------------------------
-void Map::evaluateJS(const QStringList &s, bool upd) 
+void Map::evaluateJS(const QStringList &s, bool upd)
 {
   evaluateJS(s.join("\n"), upd);
 }
index 1eb7e4388eebbae3f0859da397d37082b9c34970..c6304040ad0b5e4807562753b4a9b33979567d57 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: optionsdlg.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: optionsdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -42,19 +42,19 @@ static void SetSizeStuff(QWidget *w)
 }
 
 //------------------------------------------------------------------------
-FileDlgManager::FileDlgManager(QObject*parent, 
+FileDlgManager::FileDlgManager(QObject*parent,
                               QLineEdit *le,
                               QToolButton *tb, bool isInFile):
   QObject(parent), le(le), tb(tb), isInFile(isInFile)
 {
   connect(tb, SIGNAL(clicked()), this, SLOT(buttonClicked()));
 }
-  
+
 //------------------------------------------------------------------------
 QVariant getOptionValue(QList<FormatOption> opts, int k) {
-  if (opts[k].getValue().toString() != "") 
+  if (opts[k].getValue().toString() != "")
     return opts[k].getValue();
-  else 
+  else
     return opts[k].getDefaultValue();
 }
 
@@ -68,12 +68,12 @@ void FileDlgManager::buttonClicked()
   QString str;
   if (isInFile) {
     str = QFileDialog::getOpenFileName(0, tr("Select input file"),
-                                      le->text(), 
+                                      le->text(),
                                       "All Files (*.*)");
   }
   else {
     str = QFileDialog::getSaveFileName(0, tr("Select output file"),
-                                      le->text(), 
+                                      le->text(),
                                       "All Files (*.*)");
   }
   if (str != "")
@@ -98,11 +98,11 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
 
     QSpacerItem *horizontalSpacer = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
     horizontalLayout->addItem(horizontalSpacer);
-    
+
     QWidget *w = 0;
-    switch (options[k].getType()) 
+    switch (options[k].getType())
       {
-      case FormatOption::OPTstring: 
+      case FormatOption::OPTstring:
        {
          QLineEdit *lineEdit = new QLineEdit(this);
          SetSizeStuff(lineEdit);
@@ -112,8 +112,8 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
        }
        break;
 
-      case FormatOption::OPTinFile: 
-      case FormatOption::OPToutFile: 
+      case FormatOption::OPTinFile:
+      case FormatOption::OPToutFile:
        {
          bool inFile = options[k].getType() == FormatOption::OPTinFile;
          QLineEdit *lineEdit = new QLineEdit(this);
@@ -128,7 +128,7 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
        }
        break;
 
-      case FormatOption::OPTbool: 
+      case FormatOption::OPTbool:
        w = 0;
        break;
 
@@ -174,7 +174,7 @@ OptionsDlg::OptionsDlg(QWidget*parent,  const QString &fmtName, QList<FormatOpti
       }
     checkBoxes.push_back(checkBox);
     fields.push_back(w);
-    
+
     verticalLayout->addLayout(horizontalLayout);
   }
   QPushButton *helpButton = new QPushButton(this);
@@ -218,7 +218,7 @@ void OptionsDlg::acceptClicked()
        value = qMax(qMin(value, options[k].getMaxValue().toDouble()),options[k].getMinValue().toDouble());
        options[k].setValue(QVariant(value));
       }
-      else 
+      else
        options[k].setValue(static_cast<QLineEdit*>(fields[k])->text());
     }
   }
index dcfcbfb75dec8753ca4864df1db04f38648061b5..375c0549c0c3133b3e3f380811a32ac20ce1c67e 100644 (file)
@@ -1,5 +1,5 @@
 // -*- c++ -*-
-// $Id: processwait.cpp,v 1.2 2009/07/20 02:30:02 robertl Exp $
+// $Id: processwait.cpp,v 1.3 2009/08/28 17:08:55 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
 
 //------------------------------------------------------------------------
 
-QString ProcessWaitDialog::processErrorString( QProcess::ProcessError err) 
+QString ProcessWaitDialog::processErrorString( QProcess::ProcessError err)
 {
   switch (err)
     {
-    case QProcess::FailedToStart: 
-      return QString(tr("Process failed to start")); 
+    case QProcess::FailedToStart:
+      return QString(tr("Process failed to start"));
       break;
-    case QProcess::Crashed: 
+    case QProcess::Crashed:
       return QString(tr("Process crashed"));
       break;
     case QProcess::Timedout:
       return QString(tr("Process timedout"));
       break;
     case QProcess::WriteError:
-      return QString(tr("Error while trying to write to process")); 
+      return QString(tr("Error while trying to write to process"));
       break;
     case QProcess::ReadError:
       return QString(tr("Error while trying to read from process"));
       break;
     case QProcess::UnknownError:
     default:
-      return QString(tr("Unknown process error")); 
+      return QString(tr("Unknown process error"));
     }
   return QString("");
 }
@@ -67,23 +67,23 @@ ProcessWaitDialog::ProcessWaitDialog(QWidget *parent, QProcess *process):
   this->resize(400, 220);
   this->setWindowTitle(QString(appName) + tr(" ... Process GPSBabel"));
   QVBoxLayout *layout = new QVBoxLayout(this);
-  
+
   textEdit = new QPlainTextEdit(this);
   textEdit->setReadOnly(true);
   layout->addWidget(textEdit);
-  
+
   progressBar = new QProgressBar(this);
   progressBar->setTextVisible(false);
   layout->addWidget(progressBar);
-  
+
   buttonBox = new QDialogButtonBox(this);
   buttonBox->setOrientation(Qt::Horizontal);
   buttonBox->setStandardButtons(QDialogButtonBox::Abort);
   QPushButton* btn = buttonBox->button(QDialogButtonBox::Abort);
   btn->setText(tr("Stop Process"));
   layout->addWidget(buttonBox);
-  
-  connect(process, SIGNAL(error(QProcess::ProcessError)), 
+
+  connect(process, SIGNAL(error(QProcess::ProcessError)),
          this,    SLOT  (errorX(QProcess::ProcessError)));
   connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
          this,    SLOT  (finishedX(int, QProcess::ExitStatus)));
@@ -98,9 +98,9 @@ ProcessWaitDialog::ProcessWaitDialog(QWidget *parent, QProcess *process):
   bufferedOut = "";
 
   //
-  for (int i=0; i<=100; i+=2) 
+  for (int i=0; i<=100; i+=2)
     progressVals.push_back(i);
-  for (int i=98; i>0; i-=2) 
+  for (int i=98; i>0; i-=2)
     progressVals.push_back(i);
   progressIndex = progressVals.size()/2;
 
@@ -119,30 +119,30 @@ ProcessWaitDialog::~ProcessWaitDialog()
 {
 };
 //------------------------------------------------------------------------
-bool ProcessWaitDialog::getExitedNormally() 
+bool ProcessWaitDialog::getExitedNormally()
 {
   return (errorString.length() == 0);
 };
 
 //------------------------------------------------------------------------
-QString ProcessWaitDialog::getErrorString() 
+QString ProcessWaitDialog::getErrorString()
 {
   return errorString;
 };
 
 //------------------------------------------------------------------------
-int ProcessWaitDialog::getExitCode() 
+int ProcessWaitDialog::getExitCode()
 {
   return ecode;
 };
 
 //------------------------------------------------------------------------
-void ProcessWaitDialog::stopClickedX() 
+void ProcessWaitDialog::stopClickedX()
 {
   process->terminate();
 };
 //------------------------------------------------------------------------
-void ProcessWaitDialog::timeoutX() 
+void ProcessWaitDialog::timeoutX()
 {
   progressIndex++;
   int idx = progressIndex % progressVals.size();
@@ -166,7 +166,7 @@ void ProcessWaitDialog::errorX(QProcess::ProcessError err)
 };
 
 //------------------------------------------------------------------------
-void ProcessWaitDialog::finishedX(int exitCode, QProcess::ExitStatus es) 
+void ProcessWaitDialog::finishedX(int exitCode, QProcess::ExitStatus es)
 {
   ecode = exitCode;
   if (es == QProcess::CrashExit)
@@ -180,7 +180,7 @@ void ProcessWaitDialog::finishedX(int exitCode, QProcess::ExitStatus es)
 // appendPlainText automatically puts in a new line with every call.  That's
 // why you have to buffer it, and only append when we get a real newline.
 //
-void ProcessWaitDialog::appendToText(const char *ptr) 
+void ProcessWaitDialog::appendToText(const char *ptr)
 {
   outputString += QString(ptr);
   for (const char *cptr = ptr; *cptr; cptr++) {
@@ -197,7 +197,7 @@ void ProcessWaitDialog::appendToText(const char *ptr)
 
 
 //------------------------------------------------------------------------
-void ProcessWaitDialog::readyReadStandardErrorX() 
+void ProcessWaitDialog::readyReadStandardErrorX()
 {
   QByteArray d = process->readAllStandardError();
   appendToText(d.data());
index d20bd3d2558187adaddc521b198481f0b6145f59..9c83bea27dd63708d7dc042325f6a3f57d63e0af 100644 (file)
@@ -81,7 +81,7 @@ static void CloseSerialPort(int fileDescriptor);
 // releasing the iterator when iteration is complete.
 static kern_return_t FindModems(io_iterator_t *matchingServices)
 {
-    kern_return_t                      kernResult; 
+    kern_return_t                      kernResult;
     CFMutableDictionaryRef     classesToMatch;
 
 /*! @function IOServiceMatching
@@ -105,7 +105,7 @@ static kern_return_t FindModems(io_iterator_t *matchingServices)
                undefined. If the dictionary is a fixed-capacity dictionary and
                it is full before this operation, and the key does not exist in
                the dictionary, the behavior is undefined.
-       @param key The key of the value to set into the dictionary. If a key 
+       @param key The key of the value to set into the dictionary. If a key
                which matches this key is already present in the dictionary, only
                the value is changed ("add if absent, replace if present"). If
                no key matches the given key, the key-value pair is added to the
@@ -122,18 +122,18 @@ static kern_return_t FindModems(io_iterator_t *matchingServices)
 //        CFDictionarySetValue(classesToMatch,
 //                             CFSTR(kIOSerialBSDTypeKey),
 //                             CFSTR(kIOSerialBSDModemType));
-        
+
                // Each serial device object has a property with key
         // kIOSerialBSDTypeKey and a value that is one of kIOSerialBSDAllTypes,
         // kIOSerialBSDModemType, or kIOSerialBSDRS232Type. You can experiment with the
         // matching by changing the last parameter in the above call to CFDictionarySetValue.
-        
+
         // As shipped, this sample is only interested in modems,
-        // so add this property to the CFDictionary we're matching on. 
+        // so add this property to the CFDictionary we're matching on.
         // This will find devices that advertise themselves as modems,
         // such as built-in and USB modems. However, this match won't find serial modems.
     }
-    
+
     /*! @function IOServiceGetMatchingServices
         @abstract Look up registered IOService objects that match a matching dictionary.
         @discussion This is the preferred method of finding IOService objects currently registered by IOKit. IOServiceAddNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up.
@@ -142,17 +142,17 @@ static kern_return_t FindModems(io_iterator_t *matchingServices)
         @param existing An iterator handle is returned on success, and should be released by the caller when the iteration is finished.
         @result A kern_return_t error code. */
 
-    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, matchingServices);    
+    kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, classesToMatch, matchingServices);
     if (KERN_SUCCESS != kernResult)
     {
         printf("IOServiceGetMatchingServices returned %d\n", kernResult);
                goto exit;
     }
-        
+
 exit:
     return kernResult;
 }
-    
+
 // Given an iterator across a set of modems, return the BSD path to the first one.
 // If no modems are found the path name is set to an empty string.
 static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPath, CFIndex maxPathSize, QComboBox *box)
@@ -160,12 +160,12 @@ static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPat
     io_object_t                modemService;
     kern_return_t      kernResult = KERN_FAILURE;
     Boolean                    modemFound = false;
-    
+
     // Initialize the returned path
     *bsdPath = '\0';
-    
+
     // Iterate across all modems found. In this example, we bail after finding the first modem.
-    
+
     while ((modemService = IOIteratorNext(serialPortIterator)) && !modemFound)
     {
         CFTypeRef      bsdPathAsCFString;
@@ -181,16 +181,16 @@ static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPat
         if (bsdPathAsCFString)
         {
             Boolean result;
-            
+
             // Convert the path from a CFString to a C (NUL-terminated) string for use
                        // with the POSIX open() call.
-           
+       
                        result = CFStringGetCString((const __CFString*) bsdPathAsCFString,
                                         bsdPath,
-                                        maxPathSize, 
+                                        maxPathSize,
                                         kCFStringEncodingUTF8);
             CFRelease(bsdPathAsCFString);
-            
+
             if (result) {
                    box->addItem(bsdPath);
             }
@@ -202,7 +202,7 @@ static kern_return_t GetModemPath(io_iterator_t serialPortIterator, char *bsdPat
        
 //             (void) IOObjectRelease(modemService);
     }
-        
+
     return kernResult;
 }
 
@@ -216,4 +216,4 @@ void MainWindow::osLoadDeviceNameCombos(QComboBox *box)
   kernResult = FindModems(&serialPortIterator);
   kernResult = GetModemPath(serialPortIterator, bsdPath, sizeof(bsdPath), box);
 
-} 
+}
index 4ab743fca6b776db2e70c99d69c214defb400c19..de5278cb27197b1696d3315bdc9a65a034bfb58c 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: upgrade.cpp,v 1.9 2009/08/10 21:21:29 robertl Exp $
+// $Id: upgrade.cpp,v 1.10 2009/08/28 17:08:55 robertl Exp $
 /*
     Copyright (C) 2009  Robert Lipe, robertlipe@gpsbabel.org
 
@@ -210,7 +210,7 @@ void UpgradeCheck::httpRequestFinished(int requestId, bool error)
     information.setDefaultButton(QMessageBox::Yes);
 
     information.setText(response);
-    information.setInformativeText(tr("Do you wish do download an upgrade?"));
+    information.setInformativeText(tr("Do you wish to download an upgrade?"));
     information.setDetailedText(upgradeText);
 
     switch (information.exec()) {